<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Vendas - Pedidos</title>
</head>

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"	>
<br />
<fieldset>
<legend>
<font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
<b>VENDAS - PEDIDO N&deg;: {idpedido}</b>
</font>
</legend>

<br />

<fieldset>
<legend>
<font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
<b>Dados do cliente</b>
</font>
</legend>

<form action="#" method="post" name="form">

<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td valign="middle" height="30" colspan="4">
    <a href="#" onclick="escondeDiv('dados_end');">Esconde endere&ccedil;o</a>
    &nbsp; | &nbsp;
    <a href="#" onclick="mostraDiv('dados_end');">Mostra endere&ccedil;o</a>
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Tipo de pessoa:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
 
    <input type="radio" name="pessoa" id="f" value="1" {ck_fisica} />
	&nbsp;
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>f&iacute;sica</strong> 
    </font>
	&nbsp;
    <input type="radio" name="pessoa" id="j" value="2" {ck_juridica} />
	&nbsp;
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>jur&iacute;dica</strong> 
    </font>

    </td>
    <td width="16%" align="left">
	&nbsp;&nbsp;
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;Entrega:</strong> 
    </font>
	</td>

    <td width="27%" align="left">
    <input type="text" name="dt_ent"  size="20" maxlength="10" title="Data de Entrega" value="{dt_ent}" OnKeyUp="mascaraData(this);" />
	</td>
    
    
    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Nome/Raz&atilde;o:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="cliente"  size="30" title="Nome/Raz&atilde;o" value="{cliente}" ondblclick="abre_cadastro_pedido();" />
    <input type="hidden" name="idcliente" id="idcliente" value="{idcliente}" />
    </td>

    <td width="16%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;&nbsp;&nbsp;CNPJ/CPF:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="27%" align="left">
    <input type="text" name="doc"  size="20" title="CNPJ/CPF" value="{doc}" onKeyPress="mascara(this,soNumeros);" />
    </td>

    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

	</table>

<div id="dados_end">
	<table cellpadding="0" cellspacing="0" width="100%" >

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Nascimento:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="dtnas"  size="20" maxlength="10" title="Data de Nascimento" value="{dtnas}" OnKeyUp="mascaraData(this);" />
    </td>

    <td width="16%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;&nbsp;&nbsp;RG:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="27%" align="left">
    <input type="text" name="rg"  size="20" title="RG" value="{rg}" />
    </td>

    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Tel.Residencial:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="residencial"  size="20" title="Telefone residencial" value="{residencial}" onKeyPress="mascara(this,telefone)"/>
    </td>

    <td width="16%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;&nbsp;&nbsp;Tel.Comercial:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="27%" align="left">
    <input type="text" name="comercial"  size="20" title="Telefone Comercial" value="{comercial}" onKeyPress="mascara(this,telefone)"/>
    </td>

    </tr>


    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Celular:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="celular"  size="20" title="celular" value="{celular}" onKeyPress="mascara(this,telefone)"/>
    </td>

    <td width="16%" align="left">&nbsp;
    
    </td>
    <td width="27%" align="left">&nbsp;
	
    </td>

    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;CEP:</strong> 
    </font>
    &nbsp;
    </td>
    <td colspan="3" align="left">
    <input type="text" name="cep"  size="10" maxlength="9" title="C&oacute;digo Postal" value="{cep}" onkeyup="Formatadata(this,event)" />
    &nbsp;
    </td>


    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Logradouro:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="logradouro"  size="30" title="Logradouro" value="{logradouro}" />
    </td>

    <td colspan="2" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;&nbsp;&nbsp;Nr:</strong> 
    </font>
    &nbsp;
    <input type="text" name="numero"  size="4" title="N&uacute;mero" value="{numero}"  onKeyPress="mascara(this,soNumeros);" />
    </td>

    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Complemento:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="complemento"  size="30" title="Complemento do Endere&ccedil;o" value="{complemento}" />
    </td>

    <td width="16%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;&nbsp;&nbsp;Bairro:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="27%" align="left">
    <input type="text" name="bairro"  size="20" title="bairro" value="{bairro}" />
    </td>

    </tr>


    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Cidade:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="39%" align="left">
    <input type="text" name="cidade"  size="30" title="Cidade" value="{cidade}" />
    </td>

    <td colspan="2" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;&nbsp;&nbsp;UF:</strong> 
    </font>
    &nbsp;
    <input type="text" name="uf"  size="4" title="Estado" value="{uf}" maxlength="2" />
    </td>

    </tr>

    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

    <tr>
    <td width="18%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;E-mail:</strong> 
    </font>
    &nbsp;
    </td>
    <td colspan="4" align="left">
    <input type="text" name="email"  size="50" title="Correio Eletr&ocirc;nico" value="{email}" />
    </td>


    </tr>


    <tr>
    <td valign="middle" height="8" colspan="4">
    </td>
    </tr>

</table> 
</div>   
<input type="hidden" value="{id}" name="id" />
</form>
</fieldset>

<br />

<fieldset>
<legend>
<font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
<b>Itens do Pedido</b>
</font>
</legend>

<form name="form2">
<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td width="21%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>C&oacute;digo:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="49%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Produto:</strong> 
    </font>
    &nbsp;
    </td>

    <td align="left" colspan="4">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Observa&ccedil;&otilde;es:</strong> 
    </font>
    &nbsp;
    </td>
    </tr>

	<tr>
    <td colspan="6" height="8"></td>
    </tr>

    <tr>
    <td width="21%" align="left">
    
    <input type="text" name="referencia"  size="20" title="C&oacute;digo de referencia do Produto" value="" onclick="abre_produtos_pedido();" readonly="readonly" />
    <input type="hidden" name="idproduto" id="idproduto" value="" />
    <input type="hidden" name="pedido" id="pedido" value="{idpedido}" />
    </td>
    <td width="49%" align="left">
    <input type="text" name="descricao"  size="50" title="Descri&ccedil;&atilde;o do produto" value="" ondblclick="abre_produtos_pedido();" readonly="readonly" />
    </td>

    <td width="30%" align="left" colspan="2">
    <input type="text" name="obs_item"  size="20" title="Observa&ccedil;&atilde;o" value="" />
    </td>
    </tr>

	</table>
    
    <table cellpadding="0" cellspacing="0" width="100%">


	<tr>
    <td colspan="6" height="8"></td>
    </tr>

    <tr>
    <td width="21%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Retira Estoque:</strong> 
    </font>
    &nbsp;
    </td>
    <td width="7%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Qtde:</strong> 
    </font>
    &nbsp;
    </td>

    <td width="14%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Pre&ccedil;o:</strong> 
    </font>
    &nbsp;
    </td>

    <td width="14%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Desconto:</strong> 
    </font>
    &nbsp;
    </td>

    <td width="26%" align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>Estoque:</strong> 
    </font>
    &nbsp;
    </td>

    <td width="18%" align="left">&nbsp;
    
    </td>

    </tr>

	<tr>
    <td colspan="6" height="2"></td>
    </tr>

    <tr>
    <td width="21%" align="left">
    <input type="radio" id="estoque" name="estoque" value="1">Sim 
    <input type="radio" id="estoque2" name="estoque" value="0"  checked="checked">N&atilde;o 
    </td>
    <td width="7%" align="left">
    <input type="text" name="qtde"  size="3" title="Quantidade" value="{qtde}" />
    </td>

    <td align="left">
    <input type="text" name="vl_uni"  size="10" title="valor unit&aacute;rio" value="" />
    </td>

    <td align="left">
    <input type="text" name="desconto"  size="10" title="Desconto por item" value="{desconto}" />
    </td>

    <td align="left">
    <input type="text" name="retira"  size="20" title="Retirar de" value="{retira}" onclick="abre_locais_pedido();"  readonly="readonly"/>
    <input type="hidden" name="idretira"  size="20" value="" />
    </td>

    <td align="right">
    <input type="button" value="Inserir" onClick="inserir_item_pedido();">
	&nbsp;
    <input type="button" value="Retirar" onClick="retirar_item_pedido();">
    </td>
    </tr>

	<tr>
    <td colspan="6" height="8">
    
    </td>
    </tr>
	</table>
    <br />
    <table cellpadding="0" cellspacing="0" width="100%">
	
	<tr>
    <td colspan="2" height="30" class="barra_titulo_consultas">
    <font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
    &nbsp; <b>Descri&ccedil;&atilde;o</b>
    </font>    
    </td>
    <td width="7%" height="24" class="barra_titulo_consultas" align="center">
    <font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
    &nbsp; <b>Qtde.</b>
    </font>    
    </td>
    <td width="13%" height="24" class="barra_titulo_consultas" align="right">
    <font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
    &nbsp; <b>Vlr.Unit.</b>
    </font>    
    </td>
    <td width="14%" height="24" class="barra_titulo_consultas" align="right">
    <font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
    &nbsp; <b>Desconto</b>
    </font>    
    </td>
    <td width="14%" height="24" class="barra_titulo_consultas" align="right">
    <font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
    <b>Vlr.Total</b> &nbsp; &nbsp;
    </font>    
    </td>
    </tr>

</table>

<div id="itens">

</div>
</form>
</fieldset>


<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td valign="middle" height="10" colspan="2">
    </td>
    </tr>

    <tr>
    <td align="left" valign="middle" colspan="2">
	&nbsp;&nbsp;{botao}&nbsp;{botao2}&nbsp;{botao4}&nbsp;{botao3}
    </td>
    </tr>

    <tr>
    <td valign="middle" height="2" colspan="2">
    </td>
    </tr>

</table>


</div>
</fieldset>

</body>
</html>
